package com.zx.eval.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zx.common.utils.PageUtils;
import com.zx.common.utils.Query;

import com.zx.eval.dao.DictExtDao;
import com.zx.eval.entity.DictExtEntity;
import com.zx.eval.service.DictExtService;


@Service("dictExtService")
public class DictExtServiceImpl extends ServiceImpl<DictExtDao, DictExtEntity> implements DictExtService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String name = (String)params.get("name");
        String key1 = (String)params.get("key1");
        IPage<DictExtEntity> page = this.page(
                new Query<DictExtEntity>().getPage(params),
                new QueryWrapper<DictExtEntity>()
                .eq(!name.equals(""), "name", name)
                .eq(!key1.equals(""), "key1", key1)
                .orderByAsc("priority")
        );

        return new PageUtils(page);
    }

}
